{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="example-wrap">
                <div class="example">
                    <table class="layui-hide" id="test" lay-filter="demo"></table>
                    <!--图片模板-->
                    <script type="text/html" id="imgTpl">
                        {{# if(d.conf_img){ }}
                        <img src="{{d.conf_img}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"  />
                        {{# } }}
                    </script>
                    <!--操作模板-->
                    <script type="text/html" id="opeBar">
                        <a href="javascript:;" onclick="wk.href('{:url('jifenEdit')}?id={{d.conf_id}}')" class="btn btn-primary btn-xs m-r-xs" title="">编辑</a>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    //layui渲染数据表格
    layui.use('table', function () {
        var table = layui.table
            , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("jifen/index")}'
            ,response: {
                statusCode: 220 //成功的状态码，默认：0
            }
            , page: false
            , size: 'lg' //sm小尺寸的表格 lg大尺寸
            , cellMinWidth: 150
            , limits: [5, 10, 15, 20, 25, 30]
            , limit: 100
            , loading: true
            , id: 'testReload'
            , cols: [[
                {type:'numbers', width: 80, title: '序号'}
                , {field: 'conf_name', width: '', title: '配置名称', align: 'center'}
                , {field: 'conf_rate', width: '', title: '配置内容', align: 'center'}
                , {field: 'conf_img', width: '', title: '图片', align: 'center', templet: '#imgTpl'}
                , {fixed: 'right', width: 150, title: '操作', align: 'center', toolbar: '#opeBar'}
            ]],
            done: function (res, curr, count) {
                $('.img-circle').viewer();
            }
        });
    });
</script>
</body>
</html>